package com.gdut.Demo4;

import java.util.ArrayList;

public class StdUtil {
    private StdUtil() {}
    public static int getMaxAge(ArrayList<Student> stdList){
        int maxAge = stdList.getFirst().getAge();
        for (int i = 0; i < stdList.size(); i++) {
            if (stdList.get(i).getAge() > maxAge){
                maxAge = stdList.get(i).getAge();
            }
        }
        return maxAge;
    }
}
